package java_1_8.interface_test;

public class Animal implements Cloneable{
    private String name;
    @Override
    protected Animal clone() throws CloneNotSupportedException {
        return (Animal) super.clone();
    }


    public static void main(String[] args) throws CloneNotSupportedException {
        Animal animal=new Animal();
        animal.name="zhangsan";
        Animal animal1=animal.clone();
        System.out.println(animal==animal1);
        System.out.println(animal1.name);
    }
}
